<template>
	<view class="page consultation_doctors_list">
		<patient @info="getPatientId"></patient>
		<view class="gap-30"></view>
		<view class="card consultation_doctors_item" v-for="item in list" :key="item.id"
			@click="gotoPage(`/pagesCommon/consultation/consultationDoctorsDetails?id=${item.id}`)">
			<view class="item_text">
				<view class="title">
					会诊目的：
				</view>
				<view class="text ellipsis-2">
					{{item.objective || ''}}
				</view>
			</view>
			<view class="item_text">
				<view class="title">
					会诊时间：
				</view>
				<view class="text">
					{{$getDate(item.consultationTime)}}
					<view class="tips">
						{{item.statusName || item.status}}
					</view>
				</view>
			</view>
			<view class="item_text">
				<view class="title">
					发起医生：
				</view>
				<view class="content">
					<doctorInfo :item="{
						avatar:item.doctorAvatar,
						name:item.doctorName,
						titleName:item.titleName,
						departName:item.departName,
						levelName:item.hospitalLevelName,
						hospitalName:item.hospitalName
					}">
					</doctorInfo>
				</view>
			</view>
			<view class="item_more">
				<view class="date">
					{{$dayjs(item.createTime).format('YYYY-MM-DD HH:mm:ss')}}
				</view>
				<view class="more">
					查看详情
					<uni-icons class="icon" type="right" size="12" color="#999"></uni-icons>
				</view>
				<!-- <view class="more btns">
					去沟通
				</view> -->
			</view>
		</view>
	</view>
</template>

<script>
	import {
		queryMyConsultationInfoList
	} from '@/api/index.js'
	export default {
		name: '',
		data() {
			return {
				list: [],
				total: 0,
				queryForm: {
					pageNo: 1,
					pageSize: 10,
					patientId: 0
				}
			}
		},
		onLoad() {

		},
		methods: {
			getPatientId(value) {
				this.queryForm.patientId = value.id
				this.queryMyConsultationInfoList()
			},
			queryMyConsultationInfoList() {
				queryMyConsultationInfoList(this.queryForm).then(res => {
					this.list = res.data.list
					this.total = res.total
				}).catch(err => {
					console.log(err)
				})
			},
			gotoPage(url) {
				uni.navigateTo({
					url
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.consultation_doctors_list {
		.gap-30 {
			padding: 15rpx 0;
		}

		.consultation_doctors_item {
			margin-bottom: 30rpx;

			.item_text {
				display: flex;
				align-items: flex-start;
				font-size: 28rpx;
				margin: 15rpx 0;

				.title {
					flex: 0 0 140rpx;
					width: 140rpx;
					color: #999999;
				}

				.text {
					flex: auto;
					margin-left: 20rpx;

					.tips {
						display: inline-block;
						padding: 6rpx 15rpx;
						margin-left: 15rpx;
						color: #3E6EFE;
						border: 1px solid #3E6EFE;
						border-radius: 10rpx;
						font-size: 22rpx;
					}
				}

				.content {
					flex: auto;
					margin-left: 20rpx;
					background: #F8FAFB;
					border-radius: 10rpx;
					padding: 20rpx 10rpx;
				}
			}

			.item_more {
				.btns {
					border-radius: 10rpx;
					padding: 20rpx 50rpx;
				}

				display: flex;
				align-items: center;
				justify-content: space-between;
				font-size: 26rpx;
				color: #999999;
			}
		}
	}
</style>